#ifndef __KERNEL_ARCH_HW_KEYBOARD_H__
#define __KERNEL_ARCH_HW_KEYBOARD_H__

#include "std/std.h"
#include "dev/keyboard.h"

#ifdef __cplusplus
extern "C" {
#endif

#define	LED_SLOCK		(1)
#define	LED_NUMLOCK		(2)
#define	LED_CAPSLOCK	(4)

#define HW_KEY_FLAG_PRESS		(1 << 24)
#define HW_KEY_FLAG_REPEAT		(1 << 25)
#define HW_KEY_FLAG_RELEASE		(1 << 26)
#define HW_KEY_FLAG_ALT			(1 << 27)
#define HW_KEY_FLAG_CTRL		(1 << 28)
#define HW_KEY_FLAG_SHIFT		(1 << 29)

#define KB_SCANCODE(c)	(((c) >> 8) & 0xFFFF)
#define KB_ASCII(c)		((c) & 0xFF)

// this is used to read a key in keyboard interrupt
unsigned int hw_kb_int_read_key(void);

// translate the key to code & ascii
unsigned int kb_translate_key(unsigned int sb);

// setup the leds
void kb_update_leds(unsigned int code);

#ifdef __cplusplus
}
#endif
#endif
/* EOF */
